home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
FM Towns: Free Software Collection 10
/
FM Towns Free Software Collection 10.iso
/
ms_dos
/
tool
/
dbench
/
softtime
/
waitkey.asm
< prev
Wrap
Assembly Source File
|
1995-01-23
|
813b
|
57 lines
.MODEL SMALL,C
.CODE
ST_waitkey PROC uses si di,arg1:dword
mov di,word ptr [arg1][2]
mov si,word ptr [arg1][0]
lp: mov ah,0bh
int 21h
or al,al
jnz over ;キーを押すと抜ける
mov ah,2ch
int 21h
sub si,1
jz @f
sbb di,0
jmp lp
@@: or di,di
jnz lp ;SI=DI=0 になるまで
over: mov ax,0c00h
int 21h ;キーバッファクリア
ret
ST_waitkey ENDP
ST_getcallpskey PROC uses si di
start: mov ax,0c00h
int 21h ;キーバッファクリア
xor si,si
xor di,di
mov ah,2ch
int 21h
mov bh,dh
@@: int 21h
cmp bh,dh ;秒が変わるのを待つ
je @b
mov bh,dh
@@: mov ah,0bh
int 21h
or al,al
jnz start ;キーを押されるとやり直し
mov ah,2ch
int 21h
add si,1
adc di,0
cmp bh,dh ;秒が変わるまで繰り返す
je @b
mov ax,si
mov dx,di
ret
ST_getcallpskey ENDP
END